1. Field of the Invention
The present invention relates to an address controller, for an external memory, that controls an address for an external memory (an emulation card or a font card) that is used for a printing apparatus, etc., and to an address controlling method.
2. Related Background Art
Conventionally, a fixed, absolute address is assigned as an address for an external memory device. However, when there are a plurality of slots for external memory devices and an absolute address is individually assigned to each slot, only a specific slot can be used to load an external memory device when a program, etc., that depends on an address of the external memory device is to be stored in the external memory.
To resolve this problem, 1) a method for bank switching, and 2) a method for the employment of PIC (Position Independent Coding) and PID (Position Independent Data) have been proposed.
In 1), the method for bank switching, an identical address is assigned to all the slots for the external memory devices, and the banks are switched when data in the external memory is to be accessed by a program for a system, so that a desired slot is selected. According to this method, no matter which slot the external memory device is loaded in, the head address that is assigned to the external memory device is the same. Thus, even for a program that requires a specific address, any slot is available to load the external memory device.
With this method, however, the banks must be frequently switched when a program for a system alternately accesses data held in a plurality of external memory devices that are loaded in a plurality of slots. In addition, this method can not be employed when a program, etc., for an external memory device that is loaded in one slot is to access data, such as font data, in an external device that is loaded in another slot.
As for 2), the method for the employment of PIC and PID, when PIC is employed, at the time a program is compiled, a relative address is used for a current address, instead of an absolute address, for the designation of an address in a program so that the program is not aware of an absolute address. When PID is employed, a relative address for the head address of the external memory device is used to designate the address that is written as data. The head address of the external memory device is held in a specific register when a program is to be executed, so that an absolute address for the address in data is acquired.
According to these methods, since the program is not aware of an absolute address, access is performed without any problem, regardless of which address slot the external memory device is loaded in. The head address of the slot for the external memory device is written in a predetermined register when the program of the system is to activate a program in the external memory, so that an absolute address can be acquired regardless of which slot the external memory device is loaded in.
A problem exists, however, in that it is difficult to directly access data in external memory from the program of the system. Since the address in the data in the system is not represented by an absolute address, during the data accessing, the program of the system must be aware of which slot is being accessed, while the program must regard the address in the program as a relative address or as an absolute address. Likewise, the same problem arises when a program of an external memory device accesses the data in the system or accesses the data in an external memory that is loaded in another slot. When it is necessary to designate a relative address, an extra code procedure is always required to enable the acquisition of an absolute address, and this degrades the performance. Since PIC and PID are functions of a compiler, the above described method can not be employed for a compiler that has no such functions.